<template>
  <header>
    <div class="electric"></div>
    <div class="search">
      <img
        @click="$router.push('/')"
        src="https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/de6052b261c140ce938d0dff4de5f07b_mergeImage.png"
        alt=""
      />
      <!-- <div class="fanhui"><back></back></div> -->
      <span v-show="flag">拍婚照</span>
      <!-- <img
        src="https://lanhu.oss-cn-beijing.aliyuncs.com/ps793co14fjqdjnrs997q5psnw2urlgi9pac110a2cb-c92b-4e89-9f02-8ed5c033d5d1"
        alt=""
      /> -->
      <div class="sousuo"></div>
    </div>
  </header>
  <div class="zan"></div>
  <div class="main">
    <van-swipe class="swipper" :autoplay="3000" lazy-render>
      <van-swipe-item v-for="image in images" :key="image">
        <img :src="image" />
      </van-swipe-item>
    </van-swipe>
    <div class="strategy">
      <p>婚礼攻略</p>
      <div class="content">
        <div class="contentbox">
          <img
            src="https://lanhu.oss-cn-beijing.aliyuncs.com/psqr1kdm529kmbu13d7inpl4c81sa1g9xkca3cfcac2-211b-43a4-b28e-c3c26f0d9299"
            alt=""
          />
          <div class="contentbtm">
            <p>不敢在老家办婚礼？</p>
            <p>逆袭！婚礼大改造！</p>
          </div>
        </div>
        <div class="contentbox">
          <img src="" alt="" />
          <div class="contentbtm">
            <p>不敢在老家办婚礼？</p>
            <p>逆袭！婚礼大改造！</p>
          </div>
        </div>
        <div></div>
      </div>
    </div>
    <!-- 案例等选项卡 -->
    <van-tabs class="tab" v-model:active="activeName" line-width=".5rem">
      <van-tab title="案例推荐" name="a"
        ><div class="case" v-for="item in shop">
          <div class="caseimg">
            <img
              src="https://lanhu.oss-cn-beijing.aliyuncs.com/psswns2cjouxeelw7kff7hal4eod90psfz9f38d371c-0381-4c35-88ad-30954e55bcb9"
              alt=""
            />
          </div>
          <div class="casebtm">
            <p>洛可可三亚站水晶船婚纱照</p>
          </div>
        </div>
        <div class="morecase">
          <p>更多案例</p>
        </div>
      </van-tab>
      <van-tab title="严选品牌" name="b">内容 2</van-tab>
      <van-tab title="热门套餐" name="c">内容 3</van-tab>
    </van-tabs>
  </div>
</template>

<script>
import axios from "axios";
import { photoview } from "@/API/team/li";
export default {
  setup() {
    const images = [
      "https://lanhu.oss-cn-beijing.aliyuncs.com/psgpfz5ux8mnu1gr2v0cwsjqavr363l5taj1dfff39f-a5cf-412f-927b-d6ff8c873284",
      "https://lanhu.oss-cn-beijing.aliyuncs.com/psoz33kvm67hqlsltnwge0duc93wxo7gd9d7a1c074-17fc-4c60-afcb-08ccbcb57c74",
      "https://lanhu.oss-cn-beijing.aliyuncs.com/ps8d1u4c6xhyozn4g28h5gzoj3knvtii831562057-7db5-4ce2-a382-29f153e92754",
    ];
    return { images };
    const activeName = ref("a");
    return { activeName };
  },
  data() {
    return {
      scrollTop: "",
      flag: true,
      shop: "",
    };
  },
  async mounted() {
    window.addEventListener("scroll", this.handleScroll);
    const res = await photoview();
    this.shop = res.data;
    console.log(res.data);
  },
  methods: {
    handleScroll() {
      this.scrollTop =
        document.documentElement.scrollTop || document.body.scrollTop;
      if (this.scrollTop > 250) {
        this.flag = false;
      } else {
        this.flag = true;
      }
      // console.log(this.scrollTop);
    },
  },
};
</script>

<style lang="scss" scoped>
.zan {
  height: 1.71rem;
  padding: 0.3rem 0 0.2rem 0;
  width: 100%;
}
// .fanhui {
//   display: inline-block;
//   width: 0.2rem;
//   height: 0.32rem;
// }
header {
  position: fixed;
  top: 0;
  z-index: 3;
  padding: 0.3rem 0 0.2rem 0;
  width: 100%;
  box-sizing: border-box;
  height: 1.71rem;
  background-image: url(https://lanhu.oss-cn-beijing.aliyuncs.com/psmiuf20ac61w1raw4hxzf974ltkym54s211e8840-8a8c-47cc-a578-5a27f9e829a1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  .electric {
    width: 6.5rem;
    height: 0.26rem;
    margin: 0 auto;
    // background-image: url(https://lanhu.oss-cn-beijing.aliyuncs.com/ps8pq43wjp5hgtaeal2jrdmufnm83qpodb47ef9be9-1c0e-427a-bff3-d8ded2d36e6b);
    background-size: 6.51rem 0.26rem;
    background-repeat: no-repeat;
  }
  .search {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.2rem;
    height: 0.4rem;
    span {
      font-size: 0.3rem;
    }
    img {
      &:nth-child(1) {
        width: 0.2rem;
        height: 0.32rem;
      }
      &:nth-child(2) {
        width: 1.15rem;
        height: 0.28rem;
      }
      &:nth-child(3) {
        width: 0.28rem;
        height: 0.28rem;
      }
    }
  }
}
.main {
  width: 6.9rem;
  margin: 0 auto;
  .swipper {
    width: 100%;
    height: 2.8rem;
    img {
      width: 100%;
      height: 2.8rem;
    }
  }
  .strategy {
    margin-top: 0.84rem;
    P {
      font-size: 0.28rem;
      font-family: PingFang SC;
      font-weight: 500;
      color: #333333;
      line-height: 0.3rem;
      span {
        font-size: 0.19rem;
        float: right;
        color: #999999;
      }
    }
    .content {
      margin-top: 0.41rem;
      display: flex;
      justify-content: space-between;
      .contentbox {
        img {
          width: 100%;
        }
        position: relative;
        width: 3.3rem;
        height: 2.6rem;
        border-radius: 0.1rem 0.1rem 0 0;
        background-color: rgb(218, 161, 161);
        .contentbtm {
          display: flex;
          flex-direction: column;
          justify-content: space-around;
          width: 100%;
          height: 0.7rem;
          background-color: rgba(24, 22, 22, 0.112);
          position: absolute;
          bottom: 0;
          text-align: center;
          p {
            &:nth-child(1) {
              font-size: 0.24rem;
              font-family: PingFang SC;
              font-weight: 400;
              color: #f2f2f2;
            }
            &:nth-child(2) {
              font-size: 0.2rem;
              font-family: PingFang SC;
              font-weight: 400;
              color: rgba(255, 255, 255, 0.7);
            }
          }
        }
      }
    }
  }
  .tab {
    .morecase {
      margin-top: 15rem;
      p {
        width: 2rem;
        height: 0.48rem;
        line-height: 0.48rem;
        margin: 0 auto;
        font-size: 0.24rem;
        text-align: center;
        color: white;
        background-color: #d84141;
        border-radius: 0.1rem;
      }
    }
    .case {
      margin-top: 0.54rem;
      padding: 0 0.93rem;
      width: 100%;
      box-sizing: border-box;
      .caseimg {
        height: 3rem;
        img {
          width: 100%;
          height: 100%;
          border-radius: 0.1rem 0.1rem 0 0;
        }
      }
      .casebtm {
        padding: 0.21rem 1rem;
        background-color: #f8f8f8;
        border: 1px solid black;
        p {
          font-size: 0.24rem;
          font-weight: 500;
          text-align: center;
        }
      }
    }
  }
}
</style>
